/**
 * 将el字符串，解释为相应的dom元素
 * @param _el 
 * 如果要选择ClassName，默认为HTMLCollectionOf<Element>中第一个元素.
 */
let elAnalysis = function(_el: string): Element | null | HTMLElement {
    let el = _el.trim();
    let tem: HTMLTemplateElement;
    let Ele: HTMLElement | Element | null = null;
    if (el[0] == '#') {
        tem = <HTMLTemplateElement>document.getElementById(el.slice(1));
        console.log(tem);
        Ele = tem.content.children[0]
    } else if (el[0] == '.') {
        tem = <HTMLTemplateElement>document.getElementsByClassName(el.slice(1))[0];
        Ele = tem.content.children[0]
    }
    return Ele;
}
export { elAnalysis };